import { getAppConfigInfo,getWorkPath } from '../../env'
import { buildByPatgePath,buildByFullPath } from './buildByPatgePath'
import { writeFile } from './writeFile'

export function compileJS(){
    const {pages}=getAppConfigInfo();
    const workPath=getWorkPath();
    const appjsPath=workPath+'/app.js';
    const compileResult=[];
    pages.forEach((pagePath)=>{
       buildByPatgePath(pagePath,compileResult) 
    });
    buildByFullPath(appjsPath,compileResult);
    // console.log("compileResult:",compileResult);
    writeFile(compileResult);
}

